<template>
  <el-container class="htecontainerfluid">
    <el-aside width="300px">
      <headimg v-bind="{ getuser }"></headimg>
      <el-card class="box-card" style="margin-top: 25px;margin-bottom: 150px;">
        <ul class="nav flex-column text-center">
          <li class="nav-item">
            <router-link class="nav-link" :to="{ name:'order' }">我的订单</router-link>
          </li>
          <li class="nav-item">
            <router-link :to="{ name:'learningcard' }" class="nav-link">学习卡</router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" :to="{ name:'download' }">软件下载</router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" :to="{ name:'presentation' }">学习报告</router-link>
          </li>
          <li class="nav-item" v-if="['Teacher', 'Agent', 'Admin'].indexOf(getuser.usertype) != -1">
            <a href="/teacher.html" target="view_window" class="nav-link" >教师资料</a>
          </li>
        </ul>
      </el-card>
    </el-aside>
    <el-main>
      <router-view></router-view>
    </el-main>
  </el-container>
</template>

<script>
import { mapGetters } from "vuex";
import headimg from "../myhome/headimg.vue";
export default {
  computed: mapGetters(["getuser"]),
  methods: {
    copys(v) {
      let str = this.href(v.key_ID, v.agent_ID);
      var inputText = document.getElementById("inputText");
      inputText.value = str;
      var currentFocus = document.activeElement;
      inputText.focus();
      inputText.setSelectionRange(0, inputText.value.length);
      document.execCommand("copy", true);
      currentFocus.focus();
      this.$message({
        message: "复制成功",
        type: "success"
      });
    }
  },
  components: {
    headimg
  }
};
</script>

<style scoped>
.htecontainerfluid {
  width: 1200px;
  margin: 0 auto;
}
.box-card {
  margin-top: 20px;
  padding-bottom: 25px;
  box-shadow: 0px 0px 21px 0px rgba(0, 0, 0, 0.07);
  border-radius: 10px;
}
.nav-item {
  height: 72px;
  line-height: 72px;
}
.nav-link {
  font-family: MicrosoftYaHeiLight;
  font-size: 16px;
  font-weight: normal;
  font-stretch: normal;
  letter-spacing: 1px;
  color: #333333;
}
.router-link-active {
  color: #2f81f1;
}
</style>